﻿namespace TheMaximumPrimeNumber
{
    internal class Program
    {
        static void Main(string[] args)
        {        
            //开始的时间
            DateTime timeStart = DateTime.Now; 
            
            for( int i = 100000; i > 2; i-- )
            {       
                bool number = true;       
                for(int j = 2; j < i; j++ )
                {
                    if (i % j == 0)
                    {
                        number = false;
                        break;
                    }                                                        
                }     
            if (number == true)
            {
                    Console.WriteLine("最大质数为：" + i) ;
                    break;
            }
            }                                    
                //结束时间
                DateTime timeEnd = DateTime.Now;
                TimeSpan time = timeEnd - timeStart;               
                Console.WriteLine("运行时间：" + time);            
        }
    }
}